package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HoCheckoutApplicationMapper;
import com.ruoyi.system.domain.HoCheckoutApplication;
import com.ruoyi.system.service.IHoCheckoutApplicationService;

/**
 * 退宿申请Service业务层处理
 *
 * @author ruoyi
 * @date 2025-01-10
 */
@Service
public class HoCheckoutApplicationServiceImpl implements IHoCheckoutApplicationService {
    @Autowired
    private HoCheckoutApplicationMapper hoCheckoutApplicationMapper;

    /**
     * 查询退宿申请
     *
     * @param id 退宿申请主键
     * @return 退宿申请
     */
    @Override
    public HoCheckoutApplication selectHoCheckoutApplicationById(Long id) {
        return hoCheckoutApplicationMapper.selectHoCheckoutApplicationById(id);
    }

    /**
     * 查询退宿申请列表
     *
     * @param hoCheckoutApplication 退宿申请
     * @return 退宿申请
     */
    @Override
    public List<HoCheckoutApplication> selectHoCheckoutApplicationList(HoCheckoutApplication hoCheckoutApplication) {
        return hoCheckoutApplicationMapper.selectHoCheckoutApplicationList(hoCheckoutApplication);
    }

    /**
     * 新增退宿申请
     *
     * @param hoCheckoutApplication 退宿申请
     * @return 结果
     */
    @Override
    public int insertHoCheckoutApplication(HoCheckoutApplication hoCheckoutApplication) {
        hoCheckoutApplication.setCreateTime(DateUtils.getNowDate());
        return hoCheckoutApplicationMapper.insertHoCheckoutApplication(hoCheckoutApplication);
    }

    /**
     * 修改退宿申请
     *
     * @param hoCheckoutApplication 退宿申请
     * @return 结果
     */
    @Override
    public int updateHoCheckoutApplication(HoCheckoutApplication hoCheckoutApplication) {
        hoCheckoutApplication.setUpdateTime(DateUtils.getNowDate());
        return hoCheckoutApplicationMapper.updateHoCheckoutApplication(hoCheckoutApplication);
    }

    /**
     * 批量删除退宿申请
     *
     * @param ids 需要删除的退宿申请主键
     * @return 结果
     */
    @Override
    public int deleteHoCheckoutApplicationByIds(Long[] ids) {
        return hoCheckoutApplicationMapper.deleteHoCheckoutApplicationByIds(ids);
    }

    /**
     * 删除退宿申请信息
     *
     * @param id 退宿申请主键
     * @return 结果
     */
    @Override
    public int deleteHoCheckoutApplicationById(Long id) {
        return hoCheckoutApplicationMapper.deleteHoCheckoutApplicationById(id);
    }
}
